<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/7/11
 * Time: 13:22
 */
namespace app\admin\validate;

use think\Validate;

class Smspro extends Validate{
    protected $rule = [
        'provider_id'           => 'require',
        'username'              => 'require|max:40',
        'password'              => 'require|max:40',
        'apiid'                 => 'require|max:40',
        'apikey'                => 'require|max:40',
        'sp_code'               => 'require|number',
        'host'                  => 'require|url',
        'send'                  => 'require',
        'report_recv_url'       => 'url',
        'mo_recv_url'           => 'url',
        'status'                => 'in:1,0',
    ];
    protected $message  =   [
        'provider_id.require'       => '供应商不能为空',
        'username.require'          => '用户名不能为空',
        'password.require'          => '密码不能为空',
        'apiid.require'             => 'apiid不能为空',
        'apikey.require'            => 'apikey不能为空',
        'sp_code.require'           => '子码不能为空',
        'host.require'              => 'host不能为空',
        'send.require'              => 'send不能为空',
        'username.max'              => '用户名不能超过40个字符',
        'password.max'              => '密码不能超过40个字符',
        'apiid.max'                 => 'apiid不能超过40个字符',
        'apikey.max'                => 'apikey不能超过40个字符',
        'host.url'                  => 'host地址格式错误',
        'report_recv_url.url'       => '报告回调地址格式错误',
        'mo_recv_url.url'           => '上行回调地址格式错误',
        'need_callback.in'          => '是否回调不正确',
    ];
}